package com.example.hyw.szysteam.presenter;

import android.util.Log;

import com.example.hyw.szysteam.model.UserModel;
import com.example.hyw.szysteam.view.SettingActivity;

import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;

/**
 * Created by HYW on 2018/6/6.
 */

public class LoginOutPresenter {
    UserModel userModel=new UserModel();
    private SettingActivity settingActivity;

    public LoginOutPresenter(SettingActivity settingActivity) {
        this.settingActivity = settingActivity;
    }

    public void loginOut(){
        userModel.loginOut(settingActivity)
                .subscribeOn(Schedulers.io())
                .unsubscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new Consumer<Boolean>() {
                    @Override
                    public void accept(Boolean aBoolean) throws Exception {
                        Log.e("111","111");
                        settingActivity.loginOut();

                    }
                });
    }

}
